home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / source / test / lib-uses.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1994-05-10  |  993 b   |  37 lines  |  [TEXT/R*ch]

  1. #!/bin/sh
  2.  
  3. # This script counts the references to GDL symbols in all Xconq library games.
  4.  
  5. cd ..
  6.  
  7. /bin/rm -rf /tmp/xc7
  8.  
  9. mkdir -p /tmp/xc7/lib
  10. mkdir -p /tmp/xc7/test
  11.  
  12. for libfile in lib/*.g test/*.g ; do
  13.     sed -e 's/"[^"]*"/ /g' $libfile | sed -e 's/;.*$//g' | tr '() ' '\012' >/tmp/xc7/$libfile
  14. done
  15.  
  16. /bin/rm -f /tmp/raw-uses
  17.  
  18. # Count uses of keywords.
  19.  
  20. for file in keyword.def action.def history.def plan.def task.def goal.def ; do
  21.     for sym in `grep DEF_ kernel/${file} | sed -e 's/^[^"]*"\([^, ]*\)".*$/\1/'` ; do
  22.         rslt=`fgrep -c -x ${sym} /tmp/xc7/*/*.g | grep -v ':0$' | sed -e 's/:1//' | sed -e 's,/tmp/xc7/[a-z]*/,,' | tr '\012' ' '`
  23.         echo ${sym} '    ' ${rslt}
  24.     done
  25. done
  26.  
  27. for file in utype.def mtype.def ttype.def table.def gvar.def ; do
  28.     for sym in `grep DEF_ kernel/${file} | sed -e 's/^[^"]*"\([^, ]*\)".*$/\1/'` ; do
  29.         rslt=`fgrep -c -x ${sym} /tmp/xc7/*/*.g | grep -v ':0$' | sed -e 's/:1//' | sed -e 's,/tmp/xc7/[a-z]*/,,' | tr '\012' ' '`
  30.         echo ${sym} '    ' ${rslt}
  31.     done
  32. done
  33.  
  34.  
  35.  
  36.  
  37.